package com.xxl.job.executor.service.jobhandler;

import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import com.xxl.job.core.handler.annotation.XxlJob;
import com.xxl.job.core.log.XxlJobLogger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import java.util.concurrent.TimeUnit;

/**
 * @author wang.kang2
 * @date 2020/3/24
 * @desc
 */

@Component
public class MyJobHandler{
    private static Logger logger = LoggerFactory.getLogger(MyJobHandler.class);
    /**
     * 1、简单任务示例（Bean模式）
     */
    @XxlJob("myJobHandler")
    public ReturnT<String> demoJobHandler(String param) throws Exception {
        XxlJobLogger.log("XXL-JOB, Hello World.");

        System.out.println("hello wangkang");
        return ReturnT.SUCCESS;
    }
}
